import PDFInsuranceInstituationalClaim from './pdf.insuranceInstituationalClaim';
const PdfPrinter = require('pdfmake');
const fs = require('fs');
import { claim } from './test';
const fontpath1 = (__dirname+'/fonts/Roboto-Regular.ttf');
const fontpath2 = (__dirname+'/fonts/Roboto-Medium.ttf');
const fontpath3 = (__dirname+'/fonts/Roboto-Italic.ttf');
const fontpath4 = (__dirname+'/fonts/Roboto-MediumItalic.ttf');
const fonts = {
	Roboto: {
		normal: fontpath1,
		bold: fontpath2,
		italics: fontpath3,
		bolditalics: fontpath4
	}
};
const printer = new PdfPrinter(fonts);
const pdfIns = new PDFInsuranceInstituationalClaim();
const docDefinition = pdfIns.getPDFDefinition(claim);
const pdfDoc = printer.createPdfKitDocument(docDefinition);
pdfDoc.pipe(fs.createWriteStream(__dirname + '/pdfmake_output.pdf'));
pdfDoc.end();